package top.eggcode.modules.log.service;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import top.eggcode.component.query.CriteriaBuilder;
import top.eggcode.component.query.model.PageList;
import top.eggcode.modules.log.model.FuncLogEntity;
import top.eggcode.modules.log.model.FuncLogQuery;
import top.eggcode.modules.log.store.FuncLogRepository;
import top.eggcode.base.BaseMarkServiceImpl;

/**
 * Title:
 * Description: TODO
 * Date: 2021/5/28 17:13
 *
 * @author JiaQi Ding
 * @version 1.0
 */
@Slf4j
@Transactional(rollbackFor = Exception.class)
@AllArgsConstructor
@Service
public class FuncLogService extends BaseMarkServiceImpl<FuncLogEntity> {

    private final FuncLogRepository selfRepository;

    private final CriteriaBuilder builder;

    public PageList<FuncLogEntity> page(FuncLogQuery query) {
        return builder.createQuery(FuncLogEntity.class)
                .select()
                .fromEntity("root")
                .fetchPage(query);
    }


}
